var e = require;
var t = module;
var o = exports;
var ii, nn = this && this.__extends || (ii = function (t, e) {
    return (ii = Object.setPrototypeOf || {
        __proto__: []
    }
        instanceof Array &&
        function (t, e) {
            t.__proto__ = e
        } ||
        function (t, e) {
            for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o])
        })(t, e)
},
    function (t, e) {
        function o() {
            this.constructor = t
        }
        ii(t, e),
            t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o)
    }
),
    rr = this && this.__awaiter ||
        function (t, e, o, i) {
            return new (o || (o = Promise))(function (n, a) {
                function r(t) {
                    try {
                        l(i.next(t))
                    } catch (e) {
                        a(e)
                    }
                }
                function s(t) {
                    try {
                        l(i.
                            throw(t))
                    } catch (e) {
                        a(e)
                    }
                }
                function l(t) {
                    var e;
                    t.done ? n(t.value) : (e = t.value, e instanceof o ? e : new o(function (t) {
                        t(e)
                    })).then(r, s)
                }
                l((i = i.apply(t, e || [])).next())
            })
        };
var oo = (this && this.__decorate) ||
    function (e, t, a, n) {
        var i,
            o = arguments.length,
            s = o < 3 ? t : null === n ? (n = Object.getOwnPropertyDescriptor(t, a)) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, a, n);
        else
            for (var r = e.length - 1; r >= 0; r--)
                (i = e[r]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, a, s) : i(t, a)) || s);
        return o > 3 && s && Object.defineProperty(t, a, s), s;
    };
Object.defineProperty(o, "__esModule", { value: !0 });
var a = e("sdkConfig"),
    n = e("AD"),
    i = e("MiniGameSDK"),
    r = cc._decorator,
    s = r.ccclass,
    l = r.property,
    _ = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (t.platfrom = a.EPlatform.NO_AD), t;
        }
        return (
            nn(t, e),
            (t.prototype.onLoad = function () {
                var e = this;
                // switch (cc.sys.platform) {
                //     case cc.sys.VIVO_GAME:
                //         a.default.platform = a.EPlatform.VIVO;
                //         break;
                //     case cc.sys.OPPO_GAME:
                //         a.default.platform = a.EPlatform.OPPO;
                //         break;
                //     case cc.sys.BYTEDANCE_GAME:
                //         a.default.platform = a.EPlatform.TikTok;
                //         break;
                //     case 101:
                //         a.default.platform = a.EPlatform.NO_AD;
                //         break;
                //     default:
                a.default.platform = this.platfrom;
                console.log("xxxxxxxxxxxxxxxxx-开始");
                // }
                // (a.default.channelType = a.default.channer_info[a.default.platform]),
                //     a.default.platform == a.EPlatform.UC &&
                //     uc.setEnableDebug({
                //         enableDebug: !1,
                //         complete: function () {
                //             console.log("uc.setEnableDebug openDebug. ");
                //         }
                //     }),
                this.scheduleOnce(function () {
                    // cc.sys.platform === cc.sys.VIVO_GAME ||
                    //     cc.sys.platform === cc.sys.OPPO_GAME ||
                    //     cc.sys.platform === cc.sys.HUAWEI_GAME
                    //     ? i.default.getNetworkType(function (t) {
                    //         t
                    //             ? n.default.getInstance().init(e.GoLoadView.bind(e))
                    //             : i.default.showDialog("提示", "无网络，请退出游戏重启网络", function () {
                    //                 i.default.exitApplication();
                    //             });
                    //     })
                    //     : n.default.getInstance().init(e.GoLoadView.bind(e));
                    console.log("xxxxxxxxxxxxxxxxx-延时");
                    n.default.getInstance().init(e.GoLoadView.bind(e));
                }, 0.1);
            }),
            (t.prototype.GoLoadView = function () {
                cc.director.loadScene("Login", function () {
                    console.log("======进入Login场景=======");
                });
            }),
            oo([l({ type: cc.Enum(a.EPlatform) })], t.prototype, "platfrom", void 0),
            oo([s], t)
        );
    })(cc.Component);
o.default = _;
